1. Field of the Invention
The present invention relates to the field of computer systems. In particular, the present invention is a method and apparatus for interprocess message switching between a sender process and a plurality of receiver processes.
2. Art Background
Conventional interprocess communication facilities provide the capability of handling few message types or methods of message distribution. Typical facilities support point-to-point distribution of request messages and multicast distribution of notice messages between processes. A process is an instance of a program, an executable file, in the process of execution. A request is a call for one process to act for another. A request is usually delivered point-to-point, that is to one process (called the request handler), or is returned as undeliverable. A request entails a reply message from the request handler to the request sender. The reply indicates the results of the request. A notice is an announcement by one process that an event has occurred. A notice is usually multicasted and is delivered to a set of processes (called observers). A notice entails no reply from the observer and produces no effect on the sender, even if the notice is undeliverable. A process may act as a sender, a handler or an observer at different points during its execution.
The conventional point-to-point distribution of requests and the multicast distribution of notices have at least two shortcomings:
(1) the strict dichotomy between request and notice is inflexible, a request cannot be observed and a notice cannot be handled;
(2) the sender is burdened with identifying the message receivers.
These shortcomings have hindered the development of cooperative multiprocess applications, especially in a networked environment. For instance, a notice may need to be handled in addition to being observed. In the case where a process announces that it has created an object by sending a notice, a file containing a count of these objects should be updated as a result of the notice. To ensure the count is incremented once, one process should handle the notice while other interested processes can observe it. Under the conventional interprocess communication facilities, the updating of the count cannot be achieved with a single notice because there is no guarantee that exactly one process will update the count. A second example is where one process might keep a log of the requests made by other processes, for the purpose of allowing the other processes to review or re-execute requests. A process that can observe request messages can easily accomplish the task of reviewing or re-executing the request. Finally, the dynamic nature of processes makes it difficult for a sender process to know which processes should receive a message.
As will be described, the present invention overcomes the disadvantages of the prior art, and provides a method and apparatus for improved interprocess message switching between a sender process and a plurality of receiver processes.